/*
 * @Author: 徐建辰
 * @Date: 2022-02-13 11:10:11
 * @LastEditTime: 2022-02-13 11:15:18
 * @LastEditors: 徐建辰
 * @Description: 图片前缀全局过滤方法
 */
import {imageUrl} from '@/utils/constant'

export function imgPrefix(url) {
  if (url && url.startsWith('http')) {
    return url
  } else {
    url = `${imageUrl}${url}`
    return url
  }
}

export default app => {
  app.config.globalProperties.$filters = {imgPrefix}
}